The Common Information Model (CIM) is a standard set of classes and methods that are used to manage distributed systems. Classes can be viewed as two types: “regular” classes and association classes. “Regular” classes can be used to represent any object in a distributed system, such as a disk drive, volume, server, or switch. Association classes are used to represent relationships between objects.
As an example, let us assume that CIM_StorageVolume is a class representing the volume and CIM_StoragePool represents the pool of storage that the volume is allocated from. CIM_AllocatedFromStoragePool is a class representing the relationship between the volume and the pool. So if there is an instance sv1 of CIM_StorageVolume that is allocated from instance sp1 of CIM_StoragePool, then there would be an instance afsp1 that represents that relationship.
CIM provides methods to access the class object model. The simplest method is enumerateInstances, which enumerates all instances of a particular class. The method associators starts at a particular instance and returns all instances of related “regular” objects. For example, calling associators on sp1 with a result class of CIM_StorageVolume would return {sv1, sv2, sv3, sv4} if volumes sv1, sv2, sv3, and sv4 were created from sp1. The method references starts at a particular instance and returns all instances of related association objects. For example, calling references on sp1 with a result class of CIM_AllocatedFromStoragePool would return {afsp1, afsp2, afsp3, afsp4}.
A Storage Resource Manager (SRM) is an application that manages distributed systems, often using the CIM standard to communicate with all of the systems in a network. A “provider” is an implementation specific to each system which provides the data requested by the SRM.
A very common operation in CIM client applications is to find all relationships between instances of one class (we will call it class A) and another class (we will call it class B). However the CIM/WBEM (Web-Based Enterprise Management) interface does not define foreign keys like databases. In order to define these relationships, CIM defines another type of class called an association class, which we will call AB. A common client algorithm would be to enumerate instances of A, and then for each A, call the associators method to get all related instances of B via the AB class. This will scale as O(a*b), where a is the number of instances of class A, and b is the number of instances of class B.
Furthermore, the efficiency of the CIM provider for the AB class will vary based on implementation. The CIM client will have no information regarding the efficiency of the implementation. For example, the provider may have to do some extra work to match instances of A and B, which makes the looping algorithm even more redundant. Or there may be many more instances of A than B, in which case it would be more efficient to start the enumeration from instances of B rather than instances of A.
The only current solution is for the client to try different algorithms and see what happens. They could communicate with the provider developers to try to gain some insight on what algorithms would be more efficient, but there is no automated way to use the most efficient algorithm.